import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/city'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  
  {
    path: '/city',
    name: 'City',
    component: () => import('../views/City.vue')
  },
  {
    path: '/center',
    name: 'Center',
    component: () => import('../views/Center/Center.vue')
  },
  {
    path: '/films',
    name: 'Films',
    component: () => import('../views/Films/Films.vue'),
    children:[
      {
        path:"nowPlaying",
          component:()=>import("../views/Films/NowPlaying.vue")
      },
      {
          path:"comingSoon",
          component:()=>import("../views/Films/ComingSoon.vue")
      },
    ]
  },
  {
    path: '/film/:id',
    name: 'Film',
    component: () => import('../views/Film/Film.vue'),
  },
  
  {
    path: '/*',
    name: 'Error',
    component: () => import('../views/Error.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
